From: Sam Reed Date: Thu, 17 Mar 2011 15:14:09 +0000 (+0000) Subject: * (bug 27924) PhpHttpRequest doesn't return response body if HTTP != 200 X-Git-Tag: 1.31.0-rc.0~31366 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;h=d72508dbe728bd47b4f5442971808030279a8238;p=lhc%2Fweb%2Fwiklou.git * (bug 27924) PhpHttpRequest doesn't return response body if HTTP != 200 Apply Bawolffs patch minus the var_dump()'s --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 649c444450..c730830a78 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -115,6 +115,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 2581, bug 6834) Added links to thumbnail in several resolutions to the file description page. The sizes are set by $wgImageLimits. * (bug 28031) Add pageCount support to ArchivedFile +* (bug 27924) PhpHttpRequest doesn't return response body if HTTP != 200 === Bug fixes in 1.18 === * (bug 23119) WikiError class and subclasses are now marked as deprecated diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index cd919b4528..841b341d99 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -785,7 +785,10 @@ class PhpHttpRequest extends MWHttpRequest { return $this->status; } - if ( $this->status->isOK() ) { + // If everything went OK, or we recieved some error code + // get the response body content. + if ( $this->status->isOK() + || (int)$this->respStatus >= 300) { while ( !feof( $fh ) ) { $buf = fread( $fh, 8192 );